package AnnotationExamples.annotationUtil;

import AnnotationExamples.TestAnnotation;

import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class UseCaseTracker {


	public static void main(String[] args) {
		ArrayList<Integer> useCases = new ArrayList<>();
		Collections.addAll(useCases, 47, 48, 49, 50);
		trackUseCases(useCases, TestAnnotation.class);
	}
	public static void trackUseCases(List<Integer> useCases, Class<?> cl) {
		for (Method m : cl.getDeclaredMethods()) {
			FunctionA uc = m.getAnnotation(FunctionA.class);
			if (uc != null) {
				System.out.println(uc.id() + "  " + uc.description());
				useCases.remove(new Integer(uc.id()));
			}
		}
		for (Integer i : useCases) {
			System.out.println("warning : missing use case -" + i);
		}
	}
}
